<template>
  <div class="container">
    <div class="row pt-5">
      <div class="col-md-4 col-12">
        <!-- <div class="card" style="width: 18rem">
          <img src="../assets/img/person.jpg" class="card-img-top w-100 h-100" />
          <div class="card-body">
            <h5 class="card-title">接种患者</h5>
            <p class="card-text">提供疫苗溯源,医院查询</p>
            <router-link to="/checking" class="btn btn-primary"
              >查询系统点击此处</router-link
            >
          </div>
        </div> -->
        <div class="card_one">
          <div class="photo">
            <img src="../assets/img/person.jpg" />
          </div>
          <h1>接种患者</h1>
          <h2>提供疫苗溯源,医院查询</h2>
          <router-link to="/checking" class="btn btn-primary"
            >查询系统点击此处</router-link
          >
        </div>
      </div>
      <div class="col-md-4 col-12">
        <!-- <div class="card" style="width: 18rem">
          <img
            src="../assets/img/hosptial.jpg"
            class="card-img-top w-100 h-100"
          />
          <div class="card-body">
            <h5 class="card-title">认证医院</h5>
            <p class="card-text">经过认证的医院,为你的医疗健康保驾护航</p>
            <router-link to="/hospital" class="btn btn-primary"
              >医院系统点击此处</router-link
            >
          </div>
        </div> -->
        <div class="card_one">
          <div class="photo">
            <img src="../assets/img/hosptial.jpg"/>
          </div>
          <h1>认证医院</h1>
          <h2>经过认证的医院,为你的医疗健康保驾护航</h2>
          <router-link to="/hospital" class="btn btn-primary">医院系统点击此处</router-link>
        </div>
      </div>
      <div class="col-md-4 col-12">
        <!-- <div class="card" style="width: 18rem">
          <img
            src="../assets/img/factor.jpg"
            class="card-img-top w-100 h-100"
          />
          <div class="card-body">
            <h5 class="card-title">认证疫苗制造商</h5>
            <p class="card-text">从制造到接种全程可溯源可信赖</p>
            <router-link to="/factor" class="btn btn-primary"
              >疫苗制造企业点击此处</router-link
            >
          </div>
        </div> -->
        <div class="card_one">
          <div class="photo">
            <img src="../assets/img/factor.jpg"/>
          </div>
          <h1>认证疫苗制造商</h1>
          <h2>从制造到接种全程可溯源可信赖</h2>
          <router-link to="/factor" class="btn btn-primary"
              >疫苗制造企业点击此处</router-link
            >
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "MyCard",
};
</script>

<style>
.card_one {
  /* 相对定位 */
  position: relative;
  width: 300px;
  height: 450px;
  margin: 20px;
  background-color: #758a99;
  border-radius: 20px;
  /* 溢出隐藏 */
  overflow: hidden;
  /* 弹性布局 */
  display: flex;
  /* 元素纵向排列 */
  flex-direction: column;
  /* 居中 */
  align-items: center;
  color: #fff;
  /* 阴影 */
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  /* 不让其他被挤压 */
  flex-shrink: 0;
}
.card_one .photo img {
  width: 100%;
  height: 100%;
  /* 保持原有尺寸比例,裁切长边 */
  object-fit: cover;
}

/* 默认大图 */
.card_one .photo {
  /* 绝对定位 */
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 0%;
  overflow: hidden;
  /* 动画过渡 */
  transition: 0.5s;
}

/* 鼠标移入变小图 */
.card_one:hover .photo {
  top: 30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

/* 这里加个黑色到透明的渐变背景，可以更好的看清楚名字 */
.card_one .photo::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent 50%, #222);
}

.card_one h1 {
  position: absolute;
  top: 370px;
  transition: 0.5s;
}

.card_one:hover h1 {
  top: 170px;
}

.card_one h2 {
  margin-top: 220px;
  width: 80%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 20px;
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
}

.card_one p {
  width: 90%;
  text-indent: 32px;
  font-size: 16px;
  margin-bottom: 15px;
  line-height: 30px;
}

.card_one a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 8px 32px;
  border-radius: 8px;
}
.card_one a:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.2);
}
</style>